<?php /* Smarty version 2.6.22, created on 2010-06-19 23:56:17
         compiled from report.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'math', 'report.tpl', 55, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header_ajax.tpl", 'smarty_include_vars' => array('title' => $this->_tpl_vars['title'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<h2><?php echo $this->_tpl_vars['title']; ?>
</h2>

<!--
<div class="box">
<h4>Offers</h4>
Data <strong><?php echo $this->_tpl_vars['dataO']->CNT; ?>
</strong> entries ranges from <strong><?php echo $this->_tpl_vars['dataO']->MINDATE; ?>
</strong> to <strong><?php echo $this->_tpl_vars['dataO']->MAXDATE; ?>
</strong><br>
Total Sum: <strong><?php echo $this->_tpl_vars['dataO']->SUMM; ?>
</strong> Bucks
<h4>Invoices</h4>
Data <strong><?php echo $this->_tpl_vars['dataI']->CNT; ?>
</strong> entries ranges from <strong><?php echo $this->_tpl_vars['dataI']->MINDATE; ?>
</strong> to <strong><?php echo $this->_tpl_vars['dataI']->MAXDATE; ?>
</strong><br>
Total Sum: <strong><?php echo $this->_tpl_vars['dataI']->SUMM; ?>
</strong> Bucks
</div>
-->

<div class="box">
<form method="post" action="report.php">
<table class="righter">
<tr><td>From Date</td><td><input type="text" name="from" value="<?php echo $this->_tpl_vars['from']; ?>
"></td>
<td>To Date</td><td><input type="text" name="to" value="<?php echo $this->_tpl_vars['to']; ?>
"></td>
<td>Type</td><td><select name="type"><option value="%">Both</option><option value="O">Quotations</option><option value="I">Invoices</option></select></tr>
<tr><td>Customer</td><td><select name="customer[]" multiple size="5"><option value="%" selected>All</option><?php $_from = $this->_tpl_vars['customers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?><option value="<?php echo $this->_tpl_vars['v']->ID; ?>
"><?php echo $this->_tpl_vars['v']->FAMILYNAME; ?>
, <?php echo $this->_tpl_vars['v']->FIRSTNAME; ?>
 (<?php echo $this->_tpl_vars['v']->CITY; ?>
)</option><?php endforeach; endif; unset($_from); ?></select>
<td>Work Items</td><td><select name="works[]" multiple size="5"><option value="%" selected>All</option><?php $_from = $this->_tpl_vars['workItems']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?><option value="<?php echo $this->_tpl_vars['v']->ID; ?>
"><?php echo $this->_tpl_vars['v']->WORK_TEXT; ?>
</option><?php endforeach; endif; unset($_from); ?></select>
<td colspan="2"><input type="submit" value="generate report"></td></tr>
</table>
</form>
</div>

<div class="box">
<table class="results">
<tr>
<th>Type</th>
<th>Customer</th>
<th>Location</th>
<th>Amount</th>
<th>Price per</th>
<th>Work Item</th>
<th>Discount</th>
<th>Total</th>
<th>Date</th>
</tr>
<?php $_from = $this->_tpl_vars['rData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
<tr><!-- td><?php echo $this->_tpl_vars['v']->AOID; ?>
</td -->
<td>
<?php if ($this->_tpl_vars['v']->ITEM_TYP == 'O'): ?>Offer<?php endif; ?>
<?php if ($this->_tpl_vars['v']->ITEM_TYP == 'I'): ?>Invoice<?php endif; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->TITLE; ?>
 <?php echo $this->_tpl_vars['v']->FAMILYNAME; ?>
, <?php echo $this->_tpl_vars['v']->FIRSTNAME; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->CITY; ?>
, <?php echo $this->_tpl_vars['v']->ZIP; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->DAMOUNT; ?>
 <?php echo $this->_tpl_vars['v']->MEASURE_UNIT; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->DUNIT_PRICE; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->WORK_TEXT; ?>
</td>
<td><?php echo $this->_tpl_vars['v']->DISCOUNT; ?>
</td>
<td>
<?php echo smarty_function_math(array('equation' => "x * y * z",'x' => $this->_tpl_vars['v']->DISCOUNT,'y' => $this->_tpl_vars['v']->DAMOUNT,'z' => $this->_tpl_vars['v']->DUNIT_PRICE), $this);?>

</td>
<!-- td><?php echo $this->_tpl_vars['v']->TOTAL; ?>
</td -->
<td><?php echo $this->_tpl_vars['v']->DATE; ?>
</td>
</tr>
<?php endforeach; endif; unset($_from); ?>
</table>
SUM: <strong><?php echo $this->_tpl_vars['totalSum']->SUMM; ?>
</strong> bucks in <strong><?php echo $this->_tpl_vars['totalSum']->CNT; ?>
</strong> entries</strong>
</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>